import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';

@Injectable({
  providedIn: 'root',
})
export class ActiveTitleService {
    customersObservable: Observable<any>;
    constructor(private httpClient: HttpClient) {}
    getTitle(title: string) {
      // const title = Math.random().toFixed(2) + 'title';
      return title;
    }
    getPromiseValue() {
        return new Promise((resolve, reject) => {setTimeout( () => {
            resolve('222');
        }, 2000);
        });
    }
    reqApi(url: string, config?: any) {
        this.customersObservable = this.httpClient.get(url);
        return this.customersObservable;
    }
}
